import 'package:flutter/material.dart';
import 'package:full_display/unit/asset_utils/asset_utils.dart';

Widget buildImage(String iconName,
    {bool isPNG = true,
    double width = 22,
    double height = 22,
    Color? color,
    Color? iconColor,
    EdgeInsetsGeometry? padding,
    EdgeInsetsGeometry? margin,
    Decoration? decoration}) {
  return Container(
      padding: padding ?? const EdgeInsets.all(5),
      margin: margin,
      color: color,
      decoration: decoration,
      child: Image.asset(
        isPNG
            ? AssetUtils.getAssetImage2PNG(iconName)
            : AssetUtils.getAsset2Image(iconName),
        width: width,
        height: height,
        color: iconColor,
      ));
}
